/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.eddycar.jproyeddycar.contrato.dao;

import java.util.List;
import org.eddycar.jproyeddycar.dao.*;
import org.eddycar.jproyeddycar.contrato.modelo.*;

/**
 *
 * @author maximo
 */
public class DaoContratoEditable extends JpaDao<String,ContratoEditable>{

    @Override
    public ContratoEditable buscarId(String id) {
        return (ContratoEditable)getEm().find(ContratoEditable.class, id);
    }

    @Override
    public List<ContratoEditable> buscarTodos() {
         return getEm().createQuery("SELECT c FROM DocumentoPrivado c").getResultList();
    }
    public List<ContratoEditable> buscarPorCedula(String cedula){
        return getEm().createQuery("SELECT ce FROM ContratoEditable ce WHERE ce.codigo like'%"+cedula+"%'").getResultList();
    }
    

}
